Use Kali Linux with persistence via Ventoy. Make sure the persistence mode is working.
sudo mkdir -p /mnt/customos
sudo mount /dev/sda1 /mnt/customos
sudo unsquashfs /mnt/customos/main-*.sqsh
This will create a directory called squashfs-root/
.
sudo mount --bind /dev /squashfs-root/dev
sudo mount --bind /proc /squashfs-root/proc
sudo mount --bind /sys /squashfs-root/sys
sudo mount --bind /dev/pts /squashfs-root/dev/pts
sudo mount --bind /run /squashfs-root/run
sudo chroot squashfs-root /bin/bash
passwd # Change root password
passwd st # Optional: Change st user password
exit
sudo umount /squashfs-root/dev/pts
sudo umount /squashfs-root/dev
sudo umount /squashfs-root/proc
sudo umount /squashfs-root/sys
sudo umount /squashfs-root/run
sudo mksquashfs squashfs-root/ main-updated.sqsh
Replace the original with your modified image:
sudo mv /mnt/customos/main-*.sqsh /mnt/customos/main-original-backup.sqsh
sudo mv main-updated.sqsh /mnt/customos/main-848ed7c330d4-1511805726.923211098.sqsh